package com.hnxxxy.statistics.mapper;

import com.hnxxxy.statistics.pojo.College;
import com.hnxxxy.sysmgr.pojo.Dict;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


@Mapper
public interface SelectMapper {

    /**
     * 获取 学院的下拉菜单信息
     *
     * @param
     * @return
     */

    @Select("SELECT id,name AS dictvalue FROM stu_college")
    List<Dict> getCollegeSelectList();

    @Select("SELECT a.id AS id,a.name AS dictvalue " +
            "from stu_major a inner JOIN stu_college_major b on a.id =b.major_id " +
            "WHERE b.college_id = #{groupid}")
    List<Dict> getMajorSelectList(String groupid);

    @Select("SELECT a.id AS id,a.name AS dictvalue  " +
            "from stu_class a inner JOIN stu_major_class b on a.id =b.class_id " +
            "WHERE b.major_id = #{groupid}")
    List<Dict> getClassSelectList(String groupid);

}
